﻿using System;
using Newtonsoft.Json;

namespace Aquarinum.WebSocekt.ClientSdk.NET35.Dtos
{
    public class WebsocketMessageDto : MessageBase
    {
        /// <summary>
        ///     消息发起方
        /// </summary>
        [JsonProperty(PropertyName = "from")]
        public string From { get; set; }

        /// <summary>
        ///     消息目标方
        /// </summary>
        [JsonProperty(PropertyName = "to")]
        public string To { get; set; }

        /// <summary>
        ///     消息内容
        /// </summary>
        [JsonProperty(PropertyName = "body")]
        public string Body { get; set; }

        /// <summary>
        ///     仿造xmpp协议服务器域名
        /// </summary>
        [JsonProperty("domain")]
        public string Domain { get; set; }


        /// <summary>
        ///     消息ID
        /// </summary>
        [JsonProperty(PropertyName = "id")]
        public string Id { get; set; } = Guid.NewGuid().ToString("N");


        /// <summary>
        ///     消息创建时间
        /// </summary>
        [JsonProperty(PropertyName = "timestamp")]
        public long Timestamp { get; set; }

        /// <summary>
        ///     是否需要回执
        ///     <remarks>是否回执由服务端根据type赋值，客户端接收到消息发送固定的ReceiptMessageDto即可</remarks>
        /// </summary>
        [JsonProperty(PropertyName = "needReceipt")]
        public bool NeedReceipt { get; set; }
    }
}